package com.societyGames.interceptExercises
{
public class NumberConstantExpression implements INumberExpression
{
  private var _value:Number;

  public function NumberConstantExpression(xml:XML)
  {
    if ("@value" in xml)
    {
      this._value = Number(xml.@value);
    }
    else
    {
      throw new ArgumentError("XML missing required attribute value.");
    }
  }

  public function toString():String
  {
    return Object(this._value).toString();
  }

  //INumberExpression-->
  public function evaluate():Number
  {
    return this._value;
  }

  //<--INumberExpression
}
}